﻿using System;
using System.ComponentModel.DataAnnotations;

namespace Eqwww.Web.Areas.SystemManage.Models.Role
{
    public class CreateViewModel
    {
        [Display(Name="编码")]
        [Required(ErrorMessage ="本项不能为空")]
        [RegularExpression("[0-9a-zA-Z_]{4,100}", ErrorMessage ="本项仅能包含数字、大小写字母和下划线_，长度在4-100之间")]
        public string Name { get; set; }

        [Display(Name="名称")]
        [Required(ErrorMessage = "本项不能为空")]
        [RegularExpression("[0-9a-zA-Z_\u4e00-\u9fa5]{2,100}",ErrorMessage = "本项仅能包含数字、大小写字母、汉字和下划线_，长度在2-100之间")]
        public string ShowName { get; set; }

        [Display(Name="排序码")]
        [Required(ErrorMessage = "本项不能为空")]
        [RegularExpression("[0-9]{1,8}", ErrorMessage = "本项仅能包含0-99999999之间的数字")]
        public int? SortCode { get; set; }

        [Display(Name = "描述")]
        public string Description { get; set; }
    }
}
